package matrixMultiplicationAnalysis.Matrix;

public class matrix {
    private static int INF = 1000000007;

    public int column;
    public int row;
    public int[][] mat;


    public matrix(){
        this.column=0;
        this.row=0;
    }

    public matrix(int r,int c){
        this.column=c;
        this.row=r;
        this.mat=new int [row][column];
    }

    public matrix(int[][] nums){
        this.row=nums.length;
        this.column=nums[0].length;
        this.mat=nums.clone();
    }

    public int at(int i,int j){
        if(i>row||j>column){
            System.out.println("访问非法行或列");
            return INF;
        }
        return this.mat[i][j];
    }

    public void printMatrix(){
        System.out.println("矩阵行为 "+this.row+",列为 "+this.column);
        System.out.print("矩阵输出为\n[\n");
        for(int i=0;i<row;i++){
            for(int j=0;j<column;j++){
                System.out.print(this.mat[i][j]+" ,");
            }
            System.out.print("\n");
        }
        System.out.println("]");
    }
}
